<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "kd_city".
 *
 * @property integer $s_id
 * @property string $s_mingcheng
 * @property integer $sf_id
 */
class City extends \yii\db\ActiveRecord
{
    public function beHaviors(){
        return [
            [
                'class' => \app\components\behaviors\LogBehavior::className(),
                'tableName' => '市',
                'attributeValue' => 's_mingcheng',
            ],
        ];
    }
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'kd_city';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['s_mingcheng', 'sf_id'], 'required'],
            [['sf_id'], 'integer'],
            [['s_mingcheng'], 'string', 'max' => 20],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            's_id' => '市ID',
            's_mingcheng' => '市名称',
            'sf_id' => '省份ID',
        ];
    }
}
